function vicAfterItemUse(args)
{
    var source = args.source_unit;
vicLastActedUnit = source;
    var target = args.target_unit;
    var targetTile = args.target_tile;
    var item = args.item;
    var success = args.success; // indicates whether the skill was successful after the chance roll.
if (vicDictionaryHasKey(item.AllFlags, "move_self")) vicAfterMove(args);

if (success)
{
vicReplaceEffectsOnFlag(item, target, targetTile, "replace_effects");
vicReplaceTileOccupantsEffectsOnFlag(item, targetTile, "replace_occupants_effects");
}
else
{
vicApplyMultipleEffectsOnFlag(item, target, targetTile, "effects_on_failure"); 
vicApplyMultipleEffectsOnFlag(item, source, null, "self_effects_on_failure", false); // for effects that occur only on the source on failure
vicApplyMultipleEffectsOnFlag(item, null, source.Tile, "self_tile_effects_on_failure"); // effects on the source tile and its occupants on failure
}
}

function vicAfterItemEquip(e) 
{
    var unit = e.unit; // the unit that equipped the item
    var item = e.item; // the item equipped
}

function vicAfterItemUnequip(e) 
{
    var unit = e.unit; // the unit that unequipped the item
    var item = e.item; // the item unequipped
}